package com.xoa.controller.party;


import com.xoa.model.party.CommunitySchool;
import com.xoa.service.party.CommunitySchoolService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/CommunitySchool")
public class CommunitySchoolController {
    @Autowired
    private CommunitySchoolService communitySchoolService;

    /**
     * 查询
     * @param request
     * @param
     * @param page
     * @param pageSize
     * @return
     */
    @RequestMapping("/select")
    @ResponseBody
    public ToJson select(HttpServletRequest request, CommunitySchool communitySchool, Integer page, Integer pageSize, boolean useFlag
            , String export, HttpServletResponse response){
        return  communitySchoolService.select(request,communitySchool,page,pageSize,useFlag,export,response);
    }


    /**
     * 修改
     * @param request
     * @param communitySchool
     * @return
     */
    @RequestMapping("/update")
    @ResponseBody
    public ToJson update(HttpServletRequest request, CommunitySchool communitySchool){
        return  communitySchoolService.update(request,communitySchool);
    }

    /**
     * 删除
     * @param
     * @param
     * @param
     * @param
     * @return
     */
    @RequestMapping("/delete")
    @ResponseBody
    public ToJson delete(Integer sid){
        return  communitySchoolService.delete(sid);
    }


    /**
     * 添加
     * @param request
     * @param communitySchool
     * @param
     * @param
     * @return
     */
    @RequestMapping("/add")
    @ResponseBody
    public ToJson add(HttpServletRequest request, CommunitySchool communitySchool){
        return  communitySchoolService.add(request,communitySchool);
    }
}
